package com.wicket.okrpbff.web.contorller;

import com.wicket.okrpbff.biz.service.PowerService;
import com.wicket.okrpbff.biz.service.dto.req.*;
import com.wicket.okrpbff.biz.service.dto.res.*;
import com.wicket.okrpbff.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.wicket.okrframework.integration.FwBasePowerClient;
import com.wicket.okrframework.integration.dto.QueryPowerListRespDto;
import com.wicket.okrframework.integration.dto.QueryPowerListReqDto;
import com.wicket.okrframework.integration.FwBaseInductionRecordClient;
import com.wicket.okrframework.integration.dto.BatchQueryInductionRecordListComRespDto;
import com.wicket.okrframework.integration.dto.BatchQueryInductionRecordListComReqDto;
import java.util.stream.Collectors;
import cn.hutool.core.collection.CollectionUtil;
import com.wicket.okrframework.integration.dto.QueryPowerDetailRespDto;
import com.wicket.okrframework.integration.dto.QueryPowerDetailReqDto;
import com.wicket.okrframework.integration.dto.QueryInductionRecordInfoDetailComRespDto;
import com.wicket.okrframework.integration.dto.QueryInductionRecordInfoDetailComReqDto;
import com.wicket.okrpbff.common.exception.Assert;
import com.wicket.okrframework.integration.dto.AddPowerRespDto;
import com.wicket.okrframework.integration.dto.AddPowerReqDto;
import com.wicket.okrframework.integration.dto.UpdatePowerRespDto;
import com.wicket.okrframework.integration.dto.UpdatePowerReqDto;
import com.wicket.okrframework.integration.dto.ArchivePowerRespDto;
import com.wicket.okrframework.integration.dto.ArchivePowerReqDto;
import com.wicket.okrframework.integration.dto.ArchiveTributPowerRedisRespDto;
import com.wicket.okrframework.integration.dto.ArchiveTributPowerRedisReqDto;
import com.wicket.okrframework.integration.dto.DeletePowerRespDto;
import com.wicket.okrframework.integration.dto.DeletePowerReqDto;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@Api(value = "Power", tags = {"Power"})
@RestController
// @RequestMapping("/poms/power/")
public class PowerController {
    @Autowired
    PowerService powerService;

    /**
   * B1-2查询权限列表（平台）
   * gen by moon at 8/10/2022, 3:40:27 AM
   */
    @PostMapping("/oms/platform/power/queryPowerList")
    @ApiOperation(value = "B1-2查询权限列表（平台）", response = OkrResult.class)
    public OkrResult<BffQueryPowerListRespDto> queryPowerList(@RequestBody(required=false) @Validated BffQueryPowerListReqDto reqDTO){
        return OkrResult.success(powerService.queryPowerList(reqDTO));
    }

    /**
   * B1-2存档权限（平台）
   * gen by moon at 8/31/2022, 7:28:46 PM
   */
    @PostMapping("/oms/platform/power/archivePower")
    @ApiOperation(value = "B1-2存档权限（平台）", response = OkrResult.class)
    public OkrResult<BffArchivePowerRespDto> archivePower(@RequestBody(required=false) @Validated BffArchivePowerReqDto reqDTO){
        return OkrResult.success(powerService.archivePower(reqDTO));
    }

    /**
   * B1-2修改权限（平台）
   * gen by moon at 8/10/2022, 3:40:31 AM
   */
    @PostMapping("/oms/platform/power/updatePower")
    @ApiOperation(value = "B1-2修改权限（平台）", response = OkrResult.class)
    public OkrResult<BffUpdatePowerRespDto> updatePower(@RequestBody(required=false) @Validated BffUpdatePowerReqDto reqDTO){
        return OkrResult.success(powerService.updatePower(reqDTO));
    }

    /**
   * B1-2新增权限（平台）
   * gen by moon at 11/9/2022, 9:14:02 PM
   */
    @PostMapping("/oms/platform/power/addPower")
    @ApiOperation(value = "B1-2新增权限（平台）", response = OkrResult.class)
    public OkrResult<BffAddPowerRespDto> addPower(@RequestBody(required=false) @Validated BffAddPowerReqDto reqDTO){
        return OkrResult.success(powerService.addPower(reqDTO));
    }

    /**
   * B1-2查询权限详情（平台）
   * gen by moon at 8/10/2022, 3:40:29 AM
   */
    @PostMapping("/oms/platform/power/queryPowerDetail")
    @ApiOperation(value = "B1-2查询权限详情（平台）", response = OkrResult.class)
    public OkrResult<BffQueryPowerDetailRespDto> queryPowerDetail(@RequestBody(required=false) @Validated BffQueryPowerDetailReqDto reqDTO){
        return OkrResult.success(powerService.queryPowerDetail(reqDTO));
    }
/**
   * B1-2删除权限（平台）
   * gen by moon at 11/8/2022, 7:49:58 PM
   */
    @PostMapping("/oms/platform/mgt/power/deletePower")
    @ApiOperation(value = "B1-2删除权限（平台）", response = OkrResult.class)
    public OkrResult<BffDeletePowerRespDto> deletePower(@RequestBody(required=false) @Validated BffDeletePowerReqDto reqDTO){
        return OkrResult.success(powerService.deletePower(reqDTO));
    }

}

